<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var nums = [1.1, 1.2, 1.3, 1.4, 1.5]
        var result = [];
        for (var i = 0; i < nums.length; i++) {
            var item = nums[i];
            result.push(Math.floor(item));
        }
        console.log(result);

        function roundNums (nums) {
            var result = [];
            for (var num of nums) {
                result.push(Math.round(num));
            }
            return result;
        }
        console.log(roundNums(nums));

        var result = [];
        for (var i = 0; i < 10; i++) {
            var r = (Math.random()*100);
            result.push(Math.round(r));
        }
        console.log(result);
    </script>
</body>
</html>